package cn.initcap.designpattern.pattern.creational.simplefactory;

/**
 * 简单工厂模式
 *
 * @author initcap
 * @date 2018/8/28 AM9:08
 */
public class Test {
    public static void main(String[] args) {
        VideoFactory videoFactory1 = new VideoFactory();
        BaseVideo baseVideo1 = videoFactory1.getVideo(VideoFactory.JAVA);
        if (baseVideo1 == null) {
            return;
        }
        baseVideo1.produce();

        VideoFactory videoFactory = new VideoFactory();
        BaseVideo baseVideo = videoFactory.getVideo(JavaBaseVideo.class);
        if (baseVideo == null) {
            return;
        }
        baseVideo.produce();


    }

}
